class Solution:

    def checkStrings(self, s1: str, s2: str) -> bool:
        c1 = [[0] * 26 for _ in range(2)]
        c2 = [[0] * 26 for _ in range(2)]

        def f(c):
            return ord(c) - ord('a')

        for idx in range(len(s1)):
            i = idx & 1
            c1[i][f(s1[idx])] += 1
            c2[i][f(s2[idx])] += 1
        for i in range(26):
            if c1[0][i] != c2[0][i] or c1[1][i] != c2[1][i]:
                return False
        return True